package com.qiandao.xuexitong.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.time.LocalDateTime;

/**
 * 创建位置签到任务DTO
 */
@Data
public class CreateLocationAttendanceTaskDTO {
    
    @NotNull(message = "教室ID不能为空")
    private Long classroomId;
    @NotNull(message = "签到标题不能为空")
    private String title;
    @NotNull(message = "纬度不能为空")
    @DecimalMin(value = "-90.0", message = "纬度范围必须在-90到90之间")
    @DecimalMax(value = "90.0", message = "纬度范围必须在-90到90之间")
    private Double latitude;
    
    @NotNull(message = "经度不能为空")
    @DecimalMin(value = "-180.0", message = "经度范围必须在-180到180之间")
    @DecimalMax(value = "180.0", message = "经度范围必须在-180到180之间")
    private Double longitude;
    
    @NotNull(message = "误差范围不能为空")
    @Positive(message = "误差范围必须大于0")
    private Integer radius;

    @NotNull(message = "开始时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;
    
    @NotNull(message = "签到时长不能为空")
    @Positive(message = "签到时长必须大于0")
    private Integer duration;
} 